<template>
    <div>
        <div class="section">
            <div class="swiper-container">
                <div class="swiper-wrapper">
                    <div v-for="s in slides" class="swiper-slide">
                        <img :src="s.img_url"/>
                        <!--   <img src="./fixtures/covers/1.svg"/>-->
                    </div>

                </div>
                <div class="swiper-pagination"></div>
            </div>
            <div class="announcement">
                <label>快讯</label>
                <span>{{announcement}}</span>

            </div>
        </div>

        <div class="section">
            <div class="book-list">
                <div class="header">
                    <div class="heading">最新更新</div>
                    <div class="more">更多...</div>
                </div>
                <div class="book-items">
                    <div class="book" v-for="book in books">
                        <div class="cover"><img :src="book.img_url"></div>
                        <div class="title">{{book.title}}</div>
                        <div class="authors">{{book.authors|join}}</div>
                    </div>


                </div>
            </div>

        </div>
        <div class="section">
        </div>

    </div>
</template>


<script type="text/ecmascript-6">
    import Swiper from "swiper"
    import 'swiper/dist/css/swiper.css'
    //import a1 from './fixtures/covers/1.svg'
    //import a2 from './fixtures/covers/2.svg'

    import "./../../../../../../../../vue_15002050237YangZhuangZhi/src/list.less"
    import BookList from "./BookList.vue"
    export default{
        data(){
            announcement:'今日上架的图书全部八折',
                    slides;[
                {id:1,img_url:'./fixtures/sliders/t2.svg'},
                {id:2,img_url:'./fixtures/sliders/t2.svg'}
            ]
        }
    }

    export default{
        data(){
            return {
                announcement:'本周新书优惠,新上架电子书一律8折',
                slides: [{img_url:require('./../../../../../../.././sliders/t1.svg')}
                    , {img_url: require('./../../../../../../.././sliders/t2.svg')}]
                ,books:[{img_url:require("./../../../../../../.././covers/1.svg"),title:'揭开数据真相',authors:['tim','liu']}
                    ,{img_url:require("./../../../../../../.././covers/2.svg"),title:'Android高级进阶',authors:['大漠穷秋']}
                    ,{img_url:require("./../../../../../../.././covers/3.svg"),title:'淘宝天猫运营',authors:['唐晓君','林子雨','黄振虎']}
                ]
            }
        },
        filters:{
            join(args){
                return args.join(',')
            }
        }
        ,mounted() {
            new Swiper('.swiper-container', {
                pagination:'.swiper-pagination',//this.$refs.pagination,
                paginationClickable: true,
                spaceBetween: 30,
                centeredSlides: true,
                autoplay: 2500,
                autoplayDisableOnInteraction: false
            })
        }
    }
</script>
